package com.xiaolun.single;

//懒汉式（线程不安全）
public class Singleton3 {
    private static  Singleton3 instance;
    private Singleton3(){
    }

    //提供一个静态的公有方法，当使用到该方法时，才去创建instance
    public static Singleton3 getInstance(){
        if (instance == null){
            instance = new Singleton3();
        }
        return instance;
    }
}
